"""
>>> from simplestats.middleware import RegexLoggingMiddleware, AllLoggingMiddleware
>>> from simplestats.registration import registrar
>>> from simplestats.models import PageView
>>> from django.http import HttpRequest

>>> PageView.objects.count()
0
>>> lm = RegexLoggingMiddleware()
>>> request = HttpRequest()
>>> request.method = "GET"
>>> request.path = "/mypath/abc"
>>> lm.process_request(request)
>>> PageView.objects.count()
0
>>> registrar.register(r'^mypath')
>>> lm.process_request(request)
>>> PageView.objects.count()
1
>>> registrar.register(r'^mypath')
Traceback (most recent call last):
...
AlreadyRegistered: Pattern ^mypath is already registered with simplestats.
>>> registrar.unregister(r'^mypath')
>>> registrar.unregister(r'^mypath')
Traceback (most recent call last):
...
NotRegistered: Pattern ^mypath cannot be removed because it's not registered.
>>> lm.process_request(request)
>>> PageView.objects.count()
1
>>> lm = AllLoggingMiddleware()
>>> lm.process_request(request)
>>> PageView.objects.count()
2
"""